<?php
/**
 * User: fu
 * Date: 12-3-15
 * Time: 下午5:27
 */

class Attach extends DB{
    public function __construct(){
        parent::__construct('f_system_attach');
    }
    public function add($name,$file,$tpl){
       return $this->insert(array('name'=>$name,'file'=>$file,'tpl'=>$tpl));
    }
    public function del($id){
        return $this->delete(sprintf('id=%d',$id));
    }
    public function alt($name,$file,$tpl,$id){
        return $this->update(array('name'=>$name,'file'=>$file,'tpl'=>$tpl),sprintf('id=%d',$id));
    }
    public function queryid($id){
        return $this->select(sprintf('id=%d',$id));
    }
}
